package com.hxd.otc.common.enums;

import com.hxd.otc.R;

/**
 * Created by lzy on 2018/6/22 0022.
 * description ${公告枚举}
 */
public enum NoticeType {
    //    1消息，2.通知，3.公告
    MESSAGE("1", "消息") {
        @Override
        public int getReadResId() {
            return R.mipmap.icon_message_unread;
        }

        @Override
        public int getUnReadResId() {
            return R.mipmap.icon_message_unread;
        }

    }, NOTIFICATION("2", "通知") {
        @Override
        public int getReadResId() {
            return R.mipmap.icon_notification_unread;
        }

        @Override
        public  int getUnReadResId() {
            return R.mipmap.icon_notification_unread;
        }
    }, AFFICHE("3", "公告") {
        @Override
        public int getReadResId() {
            return R.mipmap.icon_affiche_unread;
        }

        @Override
        public int getUnReadResId() {
            return R.mipmap.icon_affiche_unread;
        }
    };

    private final String value;
    private final String desc;

    NoticeType(String value, String desc) {
        this.value = value;
        this.desc = desc;
    }

    public String getValue() {
        return value;
    }

    public String getDesc() {
        return desc;
    }

    public static NoticeType getInstance(String value) {
        if (AFFICHE.getValue().equals(value)) {
            return AFFICHE;
        } else if (NOTIFICATION.getValue().equals(value)) {
            return NOTIFICATION;
        } else {
            return MESSAGE;
        }
    }

    public abstract int getReadResId();

    public abstract int getUnReadResId();


}
